<!DOCTYPE html>
<html>
   <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>管家端</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <link rel="shortcut icon" href="/favicon.ico">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <link rel="stylesheet" href="./css/sm.min.css">
    <link rel="stylesheet" href="./css/sm-extend.min.css">
   <link href="../css/flickerplate.css"  type="text/css" rel="stylesheet">
   <link href="./css/zukeFuwuList.css" rel="stylesheet">
   <script src="../js/jquery-2.1.1.js"></script>
   <script src="../js/min/modernizr-custom-v2.7.1.min.js" type="text/javascript"></script>
   <script src="../js/min/hammer-v2.0.3.min.js" type="text/javascript"></script>
   <script src="../js/min/flickerplate.min.js" type="text/javascript"></script>
   <script src="./js/Common.js" ></script>
   <script src="./js/allZuKe.js" ></script>
   <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
	<script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
	<script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
	<script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm-extend.min.js' charset='utf-8'></script>
	<script src="./js/zepto.js"></script>
	<script src="./js/sm.js" ></script>
	<script src="../js/common.js"></script>
	<script src="./js/sm-extend.js" ></script>
	<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>  
	<script src="js/pointlog.js"></script>
	<style type="text/css">
	.searchText{
	height: 45px;
	width: 80%;
	border: 1px solid #f1f1f1;
	padding: 5px
	}
	.search{
	width: 20%;
	height: 45px;
	position: absolute;
    background: #f1f1f1;
    border: 1px solid #f1f1f1;
    float: right;
	}
	</style>
  </head>
  <body>
      <header class="bar bar-nav">
        <a class="button button-link button-nav pull-left" href="javascript:window.history.back();" data-transition='slide-out'>
          <span class="icon icon-left"></span>
        </a>
        <h1 class="title">所有业主</h1>
    </header>
<div style="width: 100%;background: #fff;position: absolute;z-index: 999;margin-top: 45px;" id="search_content">

	<div style="background:#f6f5f5;height: 45px;">
			<div class="searchbar row" style="margin: 0px 0px 0;">
			<div class="search-input col-80" style="margin-left: 0;width: 80%;">
				<label class="icon icon-search" for="search"></label> 
				<input type="search" id='keyword'  placeholder='输入姓名/手机号码' />
			</div>
			<a class="searchbar-cancel1" id="searchTxt" style="vertical-align: sub;padding-left: 16px;">搜索</a>
		</div>

	</div>
  </div>
    <div class="content" style="top:4.7em">
      <div class="list-block media-list" id="peoplelist">
      </div>
    </div>

<script type="text/javascript">
window.$$=window.Zepto = Zepto;
function toLink(txt,tagrt) {
	document.location.href = "./" + txt;
}
var storage=window.localStorage;
getUserInfo();
function  getUserInfo(){
	var flag="";
	if(storage.getItem("flag")==0) flag="租客";
	if(storage.getItem("flag")==1) flag="房东";
	if(storage.getItem("flag")==2) flag="管家";
	$("#nickName").text(storage.getItem("nickName")+"("+flag+")");
	$("#phone").text(storage.getItem("phone"));
	$("#headimg").attr("src",storage.getItem("headimg"));}
$("#butler").click(function(){
	 window.location.href = "../jsp/login.html";
})

$(function() {// 初始化内容
	load();
});

function load(){
	$$.showPreloader("加载中");
	$.ajax({
		type : "POST",
		dataType : 'json',
		url : "../houseHold/getAllUser",
		data : {
			flag : 1 ,
			searchText : $("#keyword").val()
		},
		success : function(data) {
			var html="";
			if(data.rows!=null && data.rows.length>0){
				for(var i=0;i<data.rows.length;i++){
					html+="<ul><li class=\"item-content\" onclick=\"toLink('userInfo_YeZhu.html?userId="+data.rows[i].userId+"')\">";
					html+=" <div class=\"item-media\">";
					html+="  <img src="+(data.rows[i].headImg==undefined?"":data.rows[i].headImg.split(",")[0])+" width=\"44\" height=\"44\">";
			        html+=" </div><div class=\"item-inner\"> <div class=\"item-title-row\">";
			        html+="<div class=\"item-title\">"+data.rows[i].nickName+"</div>";
			        html+=" </div> <div class=\"item-subtitle\" style=\"font-size: 12px\">"+data.rows[i].phone+"</div>";
			        html+=" </div></li> </ul>";
				}
			}else{
				html+="<ul><li class=\"item-content\">";
				  html+=" 暂无数据...</li> </ul>";
			}
			$("#peoplelist").html(html);
			$$.hidePreloader();
		},
		error: function(){
			$$.hidePreloader();
		}
	});
}
var args=ponitLog.getWindowsParam();

$("#searchTxt").click(function(){
	load();
})
</script>
  </body>
</html>

